package com.ruoyi.prod.domain;

import java.util.Date;
import java.util.List;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * 商品管理对象 tb_prod
 * 
 * @author ruoyi
 * @date 2025-08-02
 */

@Data
public class TbProd extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 商品ID */
    @Field(type = FieldType.Keyword)
    private Integer prodId;

    /** SPU */
    @Excel(name = "SPU")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodSpu;

    /** 商品类型 */
    @Excel(name = "商品类型")
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /** 商品分类 */
    @Excel(name = "商品分类")
    @Field(type = FieldType.Integer)
    private Integer prodType;

    /** 商品状态 */
    @Excel(name = "商品状态")
    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    /** 商品名称 */
    @Excel(name = "商品名称")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /** 商品品牌 */
    @Excel(name = "商品品牌")
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /** 商品单位 */
    @Excel(name = "商品单位")
    @Field(type = FieldType.Integer)
    private Integer unitId;

    /** 商品标签 */
    @Excel(name = "商品标签")
    @Field(type = FieldType.Integer)
    private Integer tagId;

    /** 供应商 */
    @Excel(name = "供应商")
    @Field(type = FieldType.Text,index = false)
    private String appr;

    /** 缩略图 */
    @Excel(name = "缩略图")
    @Field(type = FieldType.Text,index = false)
    private String prodImage;

    /** 品牌名称 */
    @Excel(name = "品牌名称")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String brandName;

    /** 类型名称 */
    @Excel(name = "类型名称")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String typeName;

    /** 商品信息信息 */
    @Field(type = FieldType.Text,index = false)
    private List<TbProdInfo> tbProdInfoList;


    /** 创建时间 */
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("prodId", getProdId())
            .append("prodSpu", getProdSpu())
            .append("prodKind", getProdKind())
            .append("prodType", getProdType())
            .append("prodStatus", getProdStatus())
            .append("prodName", getProdName())
            .append("brandId", getBrandId())
            .append("unitId", getUnitId())
            .append("tagId", getTagId())
            .append("appr", getAppr())
            .append("prodImage", getProdImage())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("tbProdInfoList", getTbProdInfoList())
            .toString();
    }
}
